
package com.sx.admin.controller.plat;

import com.sx.admin.controller.BaseController;
import com.sx.core.model.Clazz;
import com.sx.core.model.Information;
import com.sx.core.mybatis.SessionTemplate;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by lihao on 2017/6/29.
 */
@RequestMapping("plat/info")
@Controller
public class InfoPagesController extends BaseController {
    @Autowired
    SessionTemplate sessionTemplate;
    @RequestMapping("clazzs")
    public String clazzs(Model model){
        return "plat/info/clazzs";
    }

    @RequestMapping("clazzs_im")
    public String import_clazzs(Model model){
        return "plat/info/clazzs_im";
    }
    @RequestMapping("clazzs_edit")
    public String clazzs_edit(String id,Model model){
        if(StringUtils.isNotBlank(id)){
            model.addAttribute("command",sessionTemplate.get(Clazz.class,id));
        }
        return "plat/info/clazzs_edit";
    }
     @RequestMapping("class_infos")
    public String class_infos(Model model){

        return "plat/info/class_infos";
    }


    @RequestMapping("infos")
    public String infos(Model model){
        return "plat/info/infos";
    }

    @RequestMapping("infos_im")
    public String infos_im(Model model){
        model.addAttribute("clazz",sessionTemplate.list(Clazz.class));
        return "plat/info/infos_im";
    }
    @RequestMapping("infos_edit")
    public String infos_edit(String id,Model model){
        if(StringUtils.isNotBlank(id)){
            model.addAttribute("command",sessionTemplate.get(Information.class,id));
        }
        model.addAttribute("clazz",sessionTemplate.list(Clazz.class));
        return "plat/info/infos_edit";
    }



































}
